Skip to content

Conversation

@xterao
Copy link
Collaborator

@xterao xterao commented May 20, 2025

Update the file-resolution logic to dynamically retrieve the source and resource directory paths from each module’s configuration, instead of using hard-coded values. Also include test source and test resource directories, and limit the DAO/SQL file search scope to the module.

@xterao xterao added this to the 0.8.0 Release milestone May 20, 2025
@xterao xterao requested a review from Copilot May 20, 2025 10:27
@xterao xterao self-assigned this May 20, 2025
@xterao xterao added enhancement New feature or request feature labels May 20, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the file‐resolution logic to dynamically retrieve source and resource directory paths from each module’s configuration instead of using hard-coded values. It also refactors DAO and SQL file lookup methods, simplifies import statements, and removes deprecated or unused code.

  • Dynamically retrieves module directories (source, resource, test source, test resource) using CommonPathParameter.
  • Refactors DAO package renaming and SQL file path utilities to improve maintainability.
  • Removes unused code (e.g. BindVariableElement, redundant overrides) and updates file paths in test cases.

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/test/kotlin/org/domaframework/doma/intellij/DomaSqlTest.kt Updates hard-coded directory paths to use dynamic variables.
src/main/kotlin/org/domaframework/doma/intellij/refactoring/dao/DaoPackageRenameListenerProcessor.kt Adjusts handling of VirtualFile objects and package moves in DAO renaming.
src/main/kotlin/org/domaframework/doma/intellij/gutter/sql/SqlLineMakerProvider.kt Introduces PsiDaoMethod for improved SQL file method checks.
src/main/kotlin/org/domaframework/doma/intellij/formatter/block/group/subgroup/SqlUpdateValueGroupBlock.kt Removes unused code for constructing block indentation lengths.
src/main/kotlin/org/domaframework/doma/intellij/extension/ModuleExtensions.kt Replaces old path formatting with new relative SQL file path resolution.
src/main/kotlin/org/domaframework/doma/intellij/common/psi/PsiDaoMethod.kt Refactors SQL file path logic and introduces dynamic test file detection.
src/main/kotlin/org/domaframework/doma/intellij/common/dao/DaoMethodUtil.kt Updates DAO file search logic with improved path resolution.
src/main/kotlin/org/domaframework/doma/intellij/common/CommonPathParameter.kt Replaces static paths with dynamic retrieval of module source/resource directories.
Others Minor cleanups in formatting and removal of obsolete methods.
Comments suppressed due to low confidence (1)

src/main/kotlin/org/domaframework/doma/intellij/common/psi/PsiDaoMethod.kt:76

  • The variable 'daoFile' is used in setTest() but is not defined within this scope. Replace 'daoFile' with the appropriate variable (for example, psiMethod.containingFile.virtualFile) or ensure that 'daoFile' is properly defined before its usage.
isTest = pathParameter.isTest(daoFile)

@xterao xterao force-pushed the feature/dynamic-retrieval-of-source-directory-names branch from 371c551 to 2edd8fe Compare May 20, 2025 10:30
@xterao xterao merged commit 1432342 into main May 21, 2025
3 checks passed
@xterao xterao deleted the feature/dynamic-retrieval-of-source-directory-names branch May 21, 2025 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Test Directory Dynamic Retrieval of Source Directory Names

2 participants